package com.example.source.redisson;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

import java.io.IOException;

public class RedissonManager {

    private static RedissonClient redisson;

    static {
        Config config = null;
        try {
            config = Config.fromYAML(RedissonManager.class.getClassLoader().getResource("redisson.yaml"));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        redisson = Redisson.create(config);
    }

    public static RedissonClient getRedisson() {
        return redisson;
    }
}